<template>
	<view>
		<view class="pd16_15">	
			<view class="flex alcenter space mb7" >
				<view class="flex alcenter">
					<text class="ft16 ftw600 cl-main ml15">精品课程</text>
				</view>
				<navigator url="/sub_pages/course/list">
					<view class="ft14 cl-notice">更多</view>
				</navigator>
			</view>
			
			<block v-for="(item,index) in data" :key="index">
				<view class="box pd10 flex alcenter mb16" style="position: relative;" @click="getCourseInfo(item.courseId)">
					<image mode="aspectFill" class="tuan-product-l" :src="item.courseImg"></image>
					<view class="tuan-product-r pl15">
						<view class="ft18 ftw600 cl-main text-over2">{{item.courseName}}</view>
						<view class="mt16">
							<text class="ft12 cl-orange">￥{{item.price}}</text>
						</view>
						<view class="mt16 flex space alcenter">
							<view class="ft12 cl-notice">播放量：{{item.courseId}}</view>
						</view>
					</view>
				</view>
			</block>
			<!-- 
			<swiper	
				 class="home-swiper-activity flex" indicator-color="rgba(255, 255, 255, 0.3)" 
				indicator-active-color="#FFFFFF" :indicator-dots="true" 
				:autoplay="true" :interval="3000" :duration="500" :circular="true">
				<swiper-item v-for="(item,index) in data" :key="index" >
					<view class="box pd10 flex alcenter mb16" style="position: relative;" @click="getActivityInfo(value.activityId)">
						<image mode="aspectFill" class="tuan-product-l" :src="item.courseImg"></image>
						<view class="tuan-product-r pl15">
							<view class="ft14 ftw600 cl-main text-over2">{{item.courseName}}</view>
							<view class="mt16">
								<text class="ft12 cl-orange">￥{{item.price}}</text>
							</view>
							<view class="mt16 flex space alcenter">
								<view class="ft12 cl-notice">剩余{{item.courseId}}个名额</view>
							</view>
						</view>
					</view>
					
					
				</swiper-item>
			</swiper> -->
		</view>
		<dialog-birthday v-if="showBirthday" @closed="showBirthday = false"></dialog-birthday>
		<dialog-login v-if="showLogin" @loginYes="loginYes" @closed="showLogin = false"></dialog-login>
		<dialog-qrcode v-if="showQrcode" @closed="showQrcode = false"></dialog-qrcode>
		<dialog-couponshareget @loginAct="showLoginCouponShareGet" v-if="showCouponShareGet" @closed="showCouponShareGet = false"></dialog-couponshareget>
	</view>
</template>

<script>
	export default{
		props: ['data'],
		data(){
			return {
				isLogin:false,
				showBirthday:false,
				showLogin:false,
				showQrcode:false,
				showCouponShareGet:false,
			}
		},

		created(){
			//TODO 2025.8.7，手动关闭，观察对其他页面是否有影响
			// getList();
			
			
			// uni.setNavigationBarTitle({
			//     title: '夜趣小视频'
			// });
			
			// setTimeout(()=>{
			// 	this.showCouponShareGet = true;	
			// },1000);
		},
		methods:{
			//'/sub_pages/scenicArea/detail?id='+value.id
			getCourseInfo(id){
				console.log("getCourseInfo")
				uni.navigateTo({
					url:'/sub_pages/course/info?courseId='+id
				})
			},
			showLoginAct(){
				this.showLogin = true;
			},
			showLoginCouponShareGet(){
				this.showLogin = true;
			},
			loginYes(){
				
			}
		}
	}
</script>

<style>
	.home-main{
		width: 100%;
		position: relative;
		margin-top: -156rpx;
		padding: 0 30rpx;
	}
	.tuan-product-l{
		width: 320rpx;
		height: 240rpx;
		border-radius: 16rpx;
		background: #F2F2F2;
	}
	.tuan-product-r{
		width: calc(100% - 320rpx);
	}
	
	
	
	.home-swiper-activity{
		height: 300rpx;
		box-shadow: 0rpx 4rpx 32rpx 0rpx rgba(0, 0, 0, 0.04);
		border-radius: 16rpx;
		overflow: hidden;
	}
	.home-swiper-activity image{
		height: 260rpx;
		width: 100%;
	}
	
</style>
